Living body detection method and device

ABSTRACT

A living body detection method and device are disclosed. Wherein the method comprises the following steps: extracting valid depth data of a target detection object from depth map data containing the target detection object; generating a depth difference histogram based on the valid depth data; and inputting the depth difference histogram into a pre-trained machine learning classifier to obtain a determination result of whether the target detection object is a living body. By adopting this method, the detection accuracy can be improved.

The present application claims the priority to a Chinese patentapplication No. 201811608283.2, filed with the China NationalIntellectual Property Administration on Dec. 27, 2018 and entitled“LIVING BODY DETECTION METHOD AND DEVICE”, which is incorporated hereinby reference in its entirety.

TECHNICAL FIELD

The present application relates to the field of digital image processingtechnology, and in particular to a living body detection method anddevice.

BACKGROUND

With the increasing popularity of face recognition technology in thefield of public consumption, the threat of the impersonation attacks toa face authentication system is also increasing. The impersonationattacks have a very unfavorable effect on the security application ofthe face authentication system. Therefore, the face living bodydetection technology, which can also be called a face presentationattack detection technology, has been attracted more and more attention.

The existing face living body detection technology can be roughlydivided into two types according to the space dimension, wherein onetype is two-dimensional face living body detection, and the other typeis three-dimensional face living body detection. The two-dimensionalface living body detection adopts technical means including textureanalysis, background analysis, illumination model analysis, motionanalysis, interactive determination and the like. The method ofdetermining whether the face is a living body by requiring a subject tobe verified to make a real-time response meeting the requirementsthrough human-machine interaction is widely applied in practice. Inaddition, with the popularization of a near infrared imaging device anda thermal infrared imaging device, the two-dimensional face living bodydetection has been more widely used. Essentially, this type of methodrelies on an illumination model of the face illuminated by light sourceswith different wavelengths to determine whether it belongs to a livingbody.

As three-dimensional face recognition gradually enters the public'sfield of vision, correspondingly, the three-dimensional face living bodydetection technology has also been widely concerned.

Currently, a three-dimensional face living body detection scheme isdisclosed which determines whether the three-dimensional face imagecomes from a living body based on the actual curvature of multiplefeature points used in the three-dimensional face image.

The inventor finds that the three-dimensional human face living bodydetection scheme has problems in efficiency, accuracy, stability and thelike. The specific reason is analyzed as follows.

In the above-mentioned three-dimensional face living body detectionscheme, it takes a long time for curvature calculation, and only thedepth information near a part of feature points in the three-dimensionalface image is extracted during curvature calculation, which wastes theglobal information of the three-dimensional face image, which is thebottleneck for improving the accuracy. In addition, in theabove-mentioned three-dimensional face living body detection scheme,only a threshold is set to distinguish a living body from a non-livingbody, which can also limit the accuracy of the face living bodydetection.

SUMMARY

In view of this, the main object of the present application is toprovide a living body detection method and device, which can improve theaccuracy of detection.

In order to achieve the above object, an embodiment of the presentapplication proposes a living body detection method, including:

extracting valid depth data of a target detection object from depth mapdata containing the target detection object;

generating a depth difference histogram based on the valid depth data;

inputting the depth difference histogram into a pre-trained machinelearning classifier to obtain a determination result of whether thetarget detection object is a living body.

Optionally, the step of extracting valid depth data of a targetdetection object from the depth map data containing the target detectionobject includes:

extracting the depth data of the target detection object from the depthmap data of the target detection object in a manner of imagesegmentation according to a preset depth difference range;

determining whether the angle of the extracted depth data on eachcoordinate plane of a three-dimensional coordinate system is within thepreset angle range; if so, taking the extracted depth data as the validdepth data of the target detection object; otherwise, determining theextracted depth data as invalid depth data of the target detectionobject;

wherein an xy plane of the three-dimensional coordinate system isparallel to a plane where a sensor of the image capturing device foracquiring the depth map data is located, and the z-axis of thethree-dimensional coordinate system is the main optical axis of theimage capturing device.

Optionally, when the target detection object is a face, the depthdifference range is a value range of the distance between a referenceplane and a pixel in a region where the face is located in the depth mapdata; the reference plane is a plane perpendicular to the z-axis andpassing through a reference point; when the face directly faces theimage capturing device, the reference point is a nose tip of the face,and when the face does not directly face the image capturing device, thereference point is a point in the face closest to the image capturingdevice.

Optionally, the depth difference range is from 0 to 255 mm, the depthvalue accuracy is 1 mm, and the preset angle range is from −15° to +15°.

Optionally, the step of generating a depth difference histogram based onthe valid depth data comprises:

selecting the valid depth data in a preset sub-region from the validdepth data; wherein the preset sub-region is included in the regionwhere the target detection object is located;

calculating the depth difference from each pixel in the presetsub-region to a reference plane based on the selected valid depth data;wherein, the reference plane is a plane passing through a referencepoint and perpendicular to a main optical axis of an image capturingdevice for acquiring the depth map data, and the reference point is apoint in the target detection object closest to the image capturingdevice;

performing histogram statistics and then normalization processing basedon the depth difference to obtain the depth difference histogram.

Optionally, the step of selecting valid depth data in a presetsub-region from the valid depth data includes:

dividing the region where the target detection object is located intoseveral region blocks according to a preset region block division rule;and

extracting valid depth data of all the region blocks in the presetsub-region from the valid depth data.

Optionally, the preset sub-region is located in the middle of the presetdetection region.

Optionally, the machine learning classifier is a Support Vector Machine(SVM) classifier or a neural network classifier including multiplehidden layers.

In order to achieve the above object, an embodiment of the presentapplication further provides a living body detection device, including aprocessor configured for:

extracting valid depth data of a target detection object from depth mapdata containing the target detection object;

generating a depth difference histogram based on the valid depth data;

and inputting the depth difference histogram into a pre-trained machinelearning classifier to obtain a determination result of whether thetarget detection object is a living body.

Optionally, the processor is specifically configured for:

extracting depth data of the target detection object from depth map datacontaining the target detection object in a manner of image segmentationaccording to a preset depth difference range;

determining whether the angle of the extracted depth data on eachcoordinate plane of a three-dimensional coordinate system is within apreset angle range; if so, taking the extracted depth data as the validdepth data of the target detection object; otherwise, determining theextracted depth data as invalid depth data of the target detectionobject;

wherein an xy plane of the three-dimensional coordinate system isparallel to a plane where a sensor of image capturing device foracquiring the depth map data is located, the z-axis of thethree-dimensional coordinate system is the main optical axis of theimage capturing device, and the image capturing device is arranged inthe living body detection device or independently arranged outside theliving body detection device.

Optionally, when the target detection object is a face, the depthdifference range is a value range of a distance between a referenceplane and a pixel in a region where the face is located in the depth mapdata, the reference plane is a plane perpendicular to the z-axis andpassing through a reference point; when the face directly faces theimage capturing device, the reference point is the nose tip of the face,and when the face does not directly face the image capturing device, thereference point is a point in the face closest to the image capturingdevice.

Optionally, the depth difference range is from 0 to 255 mm, the depthvalue accuracy is 1 mm, and the preset angle range is from −15° to +15°.

Optionally, the processor is specifically configured for:

selecting the valid depth data in a preset sub-region from the validdepth data; wherein the preset sub-region is included in the regionwhere the target detection object is located;

calculating the depth difference from each pixel in the presetsub-region to a reference plane based on the selected valid depth data;wherein, the reference plane is a plane passing through a referencepoint and perpendicular to a main optical axis of an image capturingdevice for acquiring the depth map data, and the reference point is apoint in the target detection object closest to the image capturingdevice;

performing histogram statistics and then normalization processing basedon the depth difference to obtain the depth difference histogram.

Optionally, the processor is specifically configured for:

dividing the region where the target detection object is located intoseveral region blocks according to a preset region block division rule;and

extracting valid depth data of all the region blocks in a presetsub-region from the valid depth data.

Optionally, the preset sub-region is located in the middle of the regionwhere the target detection object is located.

Optionally, the machine learning classifier is an SVM classifier or aneural network classifier including multiple hidden layers.

In order to achieve the above object, the embodiment of the presentapplication further discloses a non-transitory computer-readable storagemedium, which stores instructions that, when executed by a processor,cause the processor to perform the steps of the living body detectionmethod as described above.

In order to achieve the above object, an embodiment of the presentapplication further discloses an electronic device, which includes theaforementioned non-transitory computer-readable storage medium, and aprocessor that can access the non-transitory computer-readable storagemedium.

In order to achieve the above object, the present application furtherdiscloses a computer-executable instruction that, when executed by aprocessor, causes the processor to perform the steps of the living bodydetection method as described above.

To sum up, in the living body detection method and device proposed inthe embodiments of the present application, the valid depth data of thepreset detection region is extracted from the depth map data of a targetdetection object; the depth difference histogram is generated based onthe valid depth data; and finally, it is determined whether the imagecorresponding to the target detection object comes from a living bodybased on the depth difference histogram and the pre-trained machinelearning classifier. According to the scheme, the living body detectionis determined by using the machine learning training mode combined withthe depth information of the preset detection region. On the one hand,living body images, photographs and images in videos (LCD/OLEDdisplayers and mobile phones) can be validly distinguished, the livingbody detection accuracy is improved. On the other hand, there is no needto calculate the curvature, which can greatly reduce the algorithmoverhead and improve the living body detection efficiency.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic flow chart of a living body detection methodprovided by an embodiment of the present application;

FIG. 2 is a schematic diagram of a side view of face depth data providedby an embodiment of the present application;

FIG. 3 is a schematic diagram of a top view of a paper photograph afterbending;

FIG. 4 is a schematic diagram of a normalized depth difference histogramaccording to an embodiment of the present application;

FIG. 5 is a schematic diagram illustrating the division of the frontalregion of a face according to an embodiment of the present application.

DETAILED DESCRIPTION

To make the objects, technical solutions and advantages of the presentapplication more apparent, the present application will be furtherdescribed in detail below with reference to the accompanying drawingsand specific embodiments.

FIG. 1 is a schematic flow chart of a living body detection methodprovided by an embodiment of the present application. As shown in FIG. 1, the living body detection method according to this embodiment mainlyincludes the following steps.

Step 101, extracting valid depth data of a preset detection region fromdepth map data of a target detection object.

In the above step 101, valid depth data of a target detection object isextracted from depth map data containing the target detection object.The above-mentioned preset detection region is an region where a targetdetection object is located. The valid depth data of the targetdetection object is the valid depth data of the region where the targetdetection object is located.

In practical applications, those skilled in the art can set a specifictarget detection object according to actual needs. The target detectionobject may be a face or a part of another living body that needs to bedetected, which is not described herein again.

Optionally, in this step, the following method may be adopted to extractthe valid depth data of the target detection object from the depth mapdata containing the target detection object:

Step 1011, extracting the depth data of the target detection object fromthe depth map data containing the target detection object in a manner ofimage segmentation according to a preset depth difference range.

In this step, in order to ensure the validity of the image data used forliving body detection, reduce the unnecessary image data involved in theliving body detection and determination, and improve the processingefficiency, it is necessary to extract, from the depth map dataincluding the target detection object, the valid depth data of thetarget detection object that can be used for living body detection, anddelete invalid depth data of the target detection object. Wherein thedepth map data is image data of the depth map.

The object processed in the present embodiment is the depth map data.The depth map data, which is provided using the currently mainstreambinocular vision-based three-dimensional reconstruction methods,Time-of-Flight (ToF)-based three-dimensional reconstruction methods,structured light-based three-dimensional reconstruction methods and thelike, can be taken as objects processed in the present embodiment. Thethree-dimensional coordinate system referred to in this embodiment isshown in FIG. 2 , in which a plane, which is parallel to the plane wherea sensor of an image capturing device that captures depth map data islocated, is taken as an xy plane, and the main optical axis of thecamera of the image capturing device (i.e., a direction perpendicular tothe plane where the sensor is located) is taken as a z-axis. Since thedepth map data provided by the image capturing device includes the validdepth data (the depth data of the target detection object) and theinvalid depth data (the depth data of a background object), imagesegmentation is performed firstly to extract the depth data of thetarget detection object.

A depth map has obvious region block features, does not have complexbackground information, and has a simpler segmentation process whencompared with a common Red Green Blue (RGB) image, thus many imagesegmentation methods can be selected to specifically implement this step(step 1011). Methods such as threshold segmentation, edge segmentation,histogram segmentation, etc. may be used to implement step 1011, whichis not specifically limited herein. By means of image segmentation, thelength and width ranges of the depth data of the target detection objecton the xy plane can be determined.

In an optional embodiment, the depth difference range is the value rangeof the distance between a reference plane and a pixel in the regionwhere the target detection object is located in the depth map data, thedepth difference is the distance between a reference plane and a pixelin the region where the target detection object is located, and thereference plane is a plane perpendicular to the z-axis and passingthrough a reference point. When the target detection object is a face ofa living being, if the face directly faces the image capturing device,the reference point is the nose tip of the face, as shown in FIG. 2 ; ifthe face does not directly face the image capturing device, thereference point is a point in the face closest to the image capturingdevice.

In an optional embodiment, when the target detection object is a face,the depth difference range may be set based on the distance differencebetween the nose tip and the ear in a depth direction.

Optionally, in order to save detection time, when the target detectionobject is a human face, the depth difference range may be set to 0 to255 mm with the depth value accuracy of 1 mm, depending on the featuresof the face, e.g., the distance difference in the depth directionbetween the nose tip and the ears in the face is generally 255 mm.

Here, for the z-axis direction corresponding to the main optical axis ofthe image capturing device, the depth data of the pixel with the depthdifference value close to 255 mm may be directly deleted, based on themain consideration that most of such depth data are very likely to benoise data, and the deletion of them not only does not affect theaccuracy of the calculation but also save the time for subsequentcalculations.

Step 1012, determining whether the angle of the extracted depth data oneach coordinate plane of the three-dimensional coordinate system iswithin a preset angle range; if so, taking the extracted depth data asthe valid depth data of the target detection object, otherwise,determining the extracted depth data as invalid depth data of the targetdetection object.

In the embodiment of the application, if the extracted depth data isdetermined as the invalid depth data of the target detection object, itis indicated that the extracted depth data cannot be used for thecurrent living body detection, and the living body detection methodends.

Wherein the preset angle range is from −15° to +15°. The xy plane of thethree-dimensional coordinate system is parallel to the plane where thesensor of the image capturing device for acquiring the depth map data islocated, and the z-axis of the three-dimensional coordinate system isthe main optical axis of the image capturing device. The coordinateplanes of the three-dimensional coordinate system include an xy plane,an xz plane, and a yz plane. The angle of the depth data on thecoordinate plane of the three-dimensional coordinate system can beunderstood as the angle between the plane directly facing the targetdetection object and the coordinate plane of the three-dimensionalcoordinate system.

In step 1012, it is considered that the accuracy of the living bodydetection is greatly reduced if the target detection object is notdirectly facing the image capturing device and the deflection angle istoo large. In this case, the depth data, whose deflection angle is toolarge, is not considered for the living body detection, so as to improvethe reliability of the detection result.

The following description will be given taking an example in which thetarget detection object is a human face. When the device is attacked bynon-human face props (such as planes of mobile phones or displayers,paper photographs, etc.), the difference between the acquired depth dataand the depth data of a human face is very large. For example, when theauthentication device is attacked by a bent paper photograph, theacquired depth data is as shown in FIG. 3 . It can be seen from FIG. 3that the depth data of a real human face is very different from thedepth data of the bent paper photograph. Accordingly, the differencebetween the depth data of the real human face and the depth data of theimage on a flat display device is more obvious. Therefore, the livingbody detection and determination based on the depth data can greatlyimprove the accuracy of detection.

Step 102, generating a depth difference histogram based on the validdepth data.

Optionally, in order to improve the efficiency of generating the depthdifference histogram and ensure the accuracy of the living bodydetection, the following method may be used to generate the depthdifference histogram in this step:

Step 1021, selecting the valid depth data in a preset sub-region fromthe valid depth data; wherein the preset sub-region is included in theregion where the target detection object is located.

Optionally, in order to improve the detection efficiency, the followingmethod may be adopted to select valid depth data in a preset sub-regionfrom the valid depth data:

Firstly, according to a preset region block division rule, the regionwhere the target detection object is located is divided into severalregion blocks.

The region block division rule may be the number of rows and columns ofthe region blocks included in the region where the target detectionobject is located.

Here, in order to facilitate the accurate screening of depth data forliving body detection, firstly, it is necessary to perform region blockdivision on the region where a target detection object is located, andthe specific region block division rule may be set by those skilled inthe art according to actual needs. For example, when the targetdetection object is a human face, during the division of the face regioninto region blocks, the face region may be divided into 5×5 regionblocks, as shown in FIG. 4 , i.e., the face region may be divided into25 region blocks.

Then, the valid depth data of all region blocks in the preset sub-regionare extracted from the valid depth data of the region where the targetdetection object is located.

Optionally, the preset sub-region may be the whole region where thetarget detection object is located, or may be a part of the region wherethe target detection object is located, and its suitable region rangecan be specifically set by those skilled in the art. Optionally, whenthe target detection object is a human face, the calculation of thedepth difference can be performed mainly on the nose, eyes, and themouth, considering that the human face can be roughly divided into fiveregions, i.e., the forehead, eyes, a nose, a mouth and a chin from topto bottom, and the main distinguishing parts of living bodies andnon-living bodies are concentrated on the nose, eyes, and mouth. In thiscase, the preset sub-region may be located in the middle of the regionwhere the target detection object is located, as long as it can coverthe nose, the eyes, and the mouth. As shown in FIG. 4 , the presetsub-region is the region where the middle 3×3 region blocks are located.

Step 1022, calculating the depth difference from each pixel in thepreset sub-region to the reference plane based on the selected validdepth data.

Wherein, the reference plane is a plane passing through the referencepoint and perpendicular to the main optical axis of the image capturingdevice for acquiring depth map data, and the reference point is a pointin the target detection object closest to the image capturing device.

Step 1023, performing histogram statistics and then normalizationprocessing based on the depth difference to obtain the depth differencehistogram.

In this step, histogram statistics is performed based on the depthdifference from each pixel to the reference plane calculated in theprevious step 1022, such as the horizontal line segment in FIG. 2 , andfinally normalization processing is performed on the histogram, that is,the depth difference of each bin (square bar) in the histogram isdivided by the depth difference of the largest bin in the histogram. Thedepth difference histogram obtained after the normalization process isshown in FIG. 5 .

Step 103, inputting the depth difference histogram into a pre-trainedmachine learning classifier to obtain a determination result of whetherthe target detection object is a living body.

Optionally, the machine learning classifier used in this step may be anSVM classifier, or may also be a neural network classifier includingmultiple hidden layers.

When the SVM classifier is adopted, the depth difference histogram ofthe positive and negative samples is used as a one-dimensional vector togenerate the final SVM classifier by training. The final SVM classifiercan be saved, and when the final SVM classifier is used, there is noneed to train the final SVM classifier. The depth difference histogramof the positive sample is depth difference histogram of the living body,and the depth difference histogram of the negative sample is the depthdifference histogram of the non-living body.

When a neural network classifier including multiple hidden layers, i.e.,a neural network classifier trained by a deep learning algorithm, isadopted, the depth difference histogram of the positive and negativesamples is input into a neural network model for training to obtain theneural network classifier. The depth difference histogram to be detectedis inputted into the neural network classifier, i.e., the above neuralnetwork classifier that has been trained, so as to obtain a living bodydetection result and finish the living body detection.

It can be seen from the above method embodiments that in the living bodydetection method proposed in the embodiments of this application, livingbody detection is performed using machine learning training incombination with the depth information of the target detection object.On the one hand, living body images, photographs and images in videos(LCD/OLED displayers and mobile phones) can be validly distinguished,and the accuracy of the living body detection is improved. On the otherhand, there is no need to calculate the curvature, which can greatlyreduce the algorithm overhead and improve the efficiency of living bodydetection.

The embodiment of the present application further provides a living bodydetection device, including a processor configured for:

extracting valid depth data of a target detection object from depth mapdata containing the target detection object;

generating a depth difference histogram based on the valid depth data;and

inputting the depth difference histogram into a pre-trained machinelearning classifier to obtain a determination result of whether thetarget detection object is a living body.

Optionally, the processor may be specifically configured for:

extracting depth data of the target detection object from depth map datacontaining the target detection object in a manner of image segmentationaccording to a preset depth difference range;

determining whether the angle of the extracted depth data on eachcoordinate plane of a three-dimensional coordinate system is within apreset angle range; if so, taking the extracted depth data as the validdepth data of the target detection object; otherwise, determining theextracted depth data as invalid depth data of the target detectionobject;

wherein an xy plane of the three-dimensional coordinate system isparallel to a plane where a sensor of image capturing device foracquiring the depth map data is located, the z-axis of thethree-dimensional coordinate system is the main optical axis of theimage capturing device, and the image capturing device is arranged inthe living body detection device or independently arranged outside theliving body detection device.

Optionally, when the target detection object is a face, the depthdifference range is a value range of a distance between a referenceplane and a pixel in a region where the face is located in the depth mapdata; the reference plane is a plane perpendicular to the z-axis andpassing through a reference point; when the face directly faces theimage capturing device, the reference point is the nose tip of the face,and when the face does not directly face the image capturing device, thereference point is a point in the face closest to the image capturingdevice.

Optionally, the depth difference range is from 0 to 255 mm, the depthvalue accuracy is 1 mm, and the preset angle range is from −15° to +15°.

Optionally, the processor may be specifically configured for:

selecting the valid depth data in a preset sub-region from the validdepth data of the target detection object; wherein the preset sub-regionis included in the region where the target detection object is located;

calculating the depth difference from each pixel in the presetsub-region to a reference plane based on the selected valid depth data;wherein, the reference plane is a plane passing through a referencepoint and perpendicular to a main optical axis of an image capturingdevice for acquiring the depth map data, and the reference point is apoint in the target detection object closest to the image capturingdevice;

performing histogram statistics and then normalization processing basedon the depth difference to obtain the depth difference histogram.

Optionally, the processor may be specifically configured for:

dividing the region where the target detection object is located intoseveral region blocks according to a preset region block division rule;and

extracting valid depth data of all region blocks in a preset sub-regionfrom the valid depth data of the target detection object.

Optionally, the preset sub-region is located in the middle of the regionwhere the target detection object is located.

Optionally, the machine learning classifier is an SVM classifier or aneural network classifier including multiple hidden layers.

It can be seen from the above device embodiments that in the living bodydetection method proposed in the embodiments of the present application,living body detection is performed using machine learning training incombination with the depth information of the target detection object.On the one hand, living body images, photographs and images in videos(LCD/OLED displayers and mobile phones) can be validly distinguished,and the accuracy of the living body detection is improved. On the otherhand, there is no need to calculate the curvature, which can greatlyreduce the algorithm overhead and improve the efficiency of living bodydetection.

Further, the present application further discloses a non-transitorycomputer-readable storage medium, which stores instructions that, whenexecuted by a processor, cause the processor to perform the steps of theliving body detection method as described above.

The present application further discloses an electronic device, whichincludes the aforementioned non-transitory computer-readable storagemedium, and a processor that can access the non-transitorycomputer-readable storage medium.

The present application further discloses a computer-executableinstruction that, when executed by a processor, causes the processor toperform the steps of the living body detection method as describedabove.

In this context, relational terms such as first and second, and are onlyused to distinguish one entity or operation from another entity oroperation without necessarily requiring or implying any actual suchrelationship or order between such entities or operation. Moreover, theterms “comprise”, “include” or any other variation thereof are intendedto cover a non-exclusive inclusion, so that a process, method, article,or device that comprises a series of elements does not include onlythose elements but may include other elements not expressly listed orinherent to such process, method, article, or device. Without furtherlimitation, an element defined by the phrase “comprising” does notexclude the presence of other identical elements in the process, method,article, or device that comprises the element.

All the embodiments in the present specification are described in arelated manner, and the same and similar parts among the embodiments maybe referred to each other, and each embodiment focuses on thedifferences from other embodiments. In particular, for the embodimentsof the living body detection device, the non-transitorycomputer-readable storage medium, the electronic device, and thecomputer-executable instructions, the description is relatively simpleas they are substantially similar to the embodiments of the living bodydetection method, and for relevant points, reference may be made to thedescription of the embodiments of the living body detection method.

The above embodiments are only the preferred embodiments of the presentapplication and are not intended to limit the present application, andany modification, equivalent replacement, improvement and the like madewithin the spirit and principle of the present application should beincluded in the protection scope of the present application.

In summary, the above embodiments are only the preferred embodiments ofthe present application, and are not intended to limit the protectionscope of the present application. Any modification, equivalentreplacement, or improvement etc. made within the spirit and principle ofthe present application should be included in the protection scope ofthe present application.

What is claimed is:
 1. A living body detection method, comprising:extracting valid depth data of a target detection object from depth mapdata containing the target detection object; generating a depthdifference histogram based on the valid depth data; and inputting thedepth difference histogram into a pre-trained machine learningclassifier to obtain a determination result of whether the targetdetection object is a living body; wherein the step of extracting validdepth data of a target detection object from depth map data containingthe target detection object comprises: extracting depth data of thetarget detection object from the depth map data containing the targetdetection object in a manner of image segmentation according to a presetdepth difference range; determining whether an angle of the extracteddepth data on each coordinate plane of a three-dimensional coordinatesystem is within a preset angle range; if this angle is within thepreset angle range, taking the extracted depth data as the valid depthdata of the target detection object; otherwise, determining theextracted depth data as invalid depth data of the target detectionobject; wherein an xy plane of the three-dimensional coordinate systemis parallel to a plane where a sensor of an image capturing device foracquiring the depth map data is located, and a z-axis of thethree-dimensional coordinate system is a main optical axis of the imagecapturing device.
 2. The method according to claim 1, wherein when thetarget detection object is a face, the depth difference range is a valuerange of a distance between a reference plane and a pixel in a regionwhere the face is located in the depth map data; the reference plane isa plane perpendicular to the z-axis and passing through a referencepoint; when the face directly faces the image capturing device, thereference point is a nose tip of the face, and when the face does notdirectly face the image capturing device, the reference point is a pointin the face closest to the image capturing device.
 3. The methodaccording to claim 2, wherein the depth difference range is from 0 to255 mm, a depth value accuracy is 1 mm, and the preset angle range isfrom −15° to +15°.
 4. The method according to claim 1, wherein the stepof generating a depth difference histogram based on the valid depth datacomprises: selecting valid depth data in a preset sub-region from thevalid depth data; wherein the preset sub-region is included in a regionwhere the target detection object is located; calculating a depthdifference from each pixel in the preset sub-region to a reference planebased on the selected valid depth data; wherein, the reference plane isa plane passing through a reference point and perpendicular to a mainoptical axis of the image capturing device for acquiring the depth mapdata, and the reference point is a point in the target detection objectclosest to the image capturing device; and performing histogramstatistics and then normalization processing based on the depthdifference to obtain the depth difference histogram.
 5. The methodaccording to claim 4, wherein the step of selecting valid depth data inthe preset sub-region from the valid depth data comprises: dividing theregion where the target detection object is located into several regionblocks according to a preset region block division rule; and extractingvalid depth data of all the region blocks in the preset sub-region fromthe valid depth data.
 6. The method according to claim 4, wherein thepreset sub-region is located in the middle of the region where thetarget detection object is located.
 7. The method according to claim 1,wherein the machine learning classifier is a Support Vector Machine(SVM) classifier or a neural network classifier comprising multiplehidden layers.
 8. A living body detection device, comprising a processorconfigured for: extracting valid depth data of a target detection objectfrom depth map data containing the target detection object; generating adepth difference histogram based on the valid depth data; and inputtingthe depth difference histogram into a pre-trained machine learningclassifier to obtain a determination result of whether the targetdetection object is a living body; wherein the processor is specificallyconfigured for: extracting depth data of the target detection objectfrom the depth map data containing the target detection object in amanner of image segmentation according to a preset depth differencerange; determining whether an angle of the extracted depth data on eachcoordinate plane of a three-dimensional coordinate system is within apreset angle range; if this angle is within the preset angle range,taking the extracted depth data as the valid depth data of the targetdetection object; otherwise, determining the extracted depth data asinvalid depth data of the target detection object; wherein an xy planeof the three-dimensional coordinate system is parallel to a plane wherea sensor of an image capturing device for acquiring the depth map datais located, a z-axis of the three-dimensional coordinate system is amain optical axis of the image capturing device, and the image capturingdevice is arranged in the living body detection device or independentlyarranged outside the living body detection device.
 9. The deviceaccording to claim 8, wherein when the target detection object is aface, the depth difference range is a value range of a distance betweena reference plane and a pixel in a region where the face is located inthe depth map data; the reference plane is a plane perpendicular to thez-axis and passing through a reference point; when the face directlyfaces the image capturing device, the reference point is a nose tip ofthe face, and when the face does not directly face the image capturingdevice, the reference point is a point in the face closest to the imagecapturing device.
 10. The device according to claim 9, wherein the depthdifference range is from 0 to 255 mm, a depth value accuracy is 1 mm,and the preset angle range is from −15° to +15°.
 11. The deviceaccording to claim 8, wherein the processor is specifically configuredfor: selecting valid depth data in a preset sub-region from the validdepth data; wherein the preset sub-region is included in a region wherethe target detection object is located; calculating a depth differencefrom each pixel in the preset sub-region to a reference plane based onthe selected valid depth data; wherein, the reference plane is a planepassing through a reference point and perpendicular to a main opticalaxis of the image capturing device for acquiring the depth map data, andthe reference point is a point in the target detection object closest tothe image capturing device; and performing histogram statistics and thennormalization processing based on the depth difference to obtain thedepth difference histogram.
 12. The device according to claim 11,wherein the processor is specifically configured for: dividing theregion where the target detection object is located into several regionblocks according to a preset region block division rule; and extractingvalid depth data of all the region blocks in the preset sub-region fromthe valid depth data.
 13. The device according to claim 12, wherein thepreset sub-region is located in the middle of the region where thetarget detection object is located.
 14. The device according to claim 8,wherein the machine learning classifier is a Support Vector Machine(SVM) classifier or a neural network classifier comprising multiplehidden layers.
 15. An electronic device comprising the non-transitorycomputer-readable storage medium having stored thereon instructionsthat, when executed by a processor, cause the processor to perform aliving body detection method, and the processor that can access thenon-transitory computer-readable storage medium; wherein the living bodydetection method comprises: extracting valid depth data of a targetdetection object from depth map data containing the target detectionobject; generating a depth difference histogram based on the valid depthdata; and inputting the depth difference histogram into a pre-trainedmachine learning classifier to obtain a determination result of whetherthe target detection object is a living body; wherein the step ofextracting valid depth data of a target detection object from depth mapdata containing the target detection object comprises: extracting depthdata of the target detection object from the depth map data containingthe target detection object in a manner of image segmentation accordingto a preset depth difference range; determining whether an angle of theextracted depth data on each coordinate plane of a three-dimensionalcoordinate system is within a preset angle range; if this angle iswithin the preset angle range, taking the extracted depth data as thevalid depth data of the target detection object; otherwise, determiningthe extracted depth data as invalid depth data of the target detectionobject; wherein an xy plane of the three-dimensional coordinate systemis parallel to a plane where a sensor of an image capturing device foracquiring the depth map data is located, and a z-axis of thethree-dimensional coordinate system is a main optical axis of the imagecapturing device.